<?php
namespace Lib\Loaders;

use EasySwoole\Component\Di;
use Medoo\Medoo;

class MysqlLoader implements \Base\LoaderInterface
{
    public static function handle()
    {
        $db = new Medoo([
            'database_type' => 'mysql',
            'database_name' => config('db.pet.db'),
            'server' => config('db.pet.host'),
            'username' => config('db.pet.user'),
            'password' => config('db.pet.pwd'),
            'charset' => 'utf8'
        ]);

        Di::getInstance()->set('mysql_pet', $db);
    }
}
